Such information processing devices have recently been proposed that perform sequence processing of a PLC or the like utilizing a general-purpose personal computer, and also perform information processing. These information processing devices utilizing general-purpose personal computers can be classified into the followings:
(1) A type in which a PLC board is connected to a slot of a general-purpose computer (which will be referred to as a "board PLC").
(2) A type in which a general-purpose personal computer is added to a PLC (which will be referred to as a "PLC+personal computer"), and
(3) A type in which an intended function is provided by software on a general-purpose personal computer (which will be referred to as a "software PLC").
FIG. 16 is a block diagram showing a schematic structure of the board PLC. Board PLC 15 has a structure in which a PLC board 20 is connected to a slot of a general-purpose personal computer 10 (which will be simply referred to as a "personal computer" hereinafter) through a personal computer expansion bus 30.
Personal computer 10 includes a microprocessor unit (MPU1) 11 and a work memory 12.
PLC board 20 includes a ladder interpreter 21, a memory 22, a microprocessor unit (MPU2) 23, a read-only memory (ROM) 24 and a buffer 25.
Memory 22 includes a user memory UM for storing a ladder program which is a user program, and an input/output memory IOM for storing input/output information.
In the above structure, ladder interpreter 21 has a function as a bus controller, so that microprocessor unit (MPU1) 11 of personal computer 10 can access memory 22 of PLC board 20 through personal computer expansion bus 30. ladder interpreter 21 can access work memory 12 of personal computer 10 through personal computer expansion bus 30.
The processing of PLC can be basically classified into two kinds of processing, i.e., "instruction execution" for interpreting and executing a ladder program and "peripheral processing" for performing input refreshing (IN-refreshing) and output refreshing (OUT-refreshing) of an input/output port (I/O) and others.
In the board PLC shown in FIG. 16, the ladder interpreter 21 fetches and decodes a ladder program stored in user memory UM of memory 22 for the above "instruction execution".
Read-only memory (ROM) 24 in PLC board 20 has stored a peripheral processing program for the foregoing "peripheral processing". Microprocessor unit (MPU2) 23 executes the "peripheral processing" using the peripheral processing program stored in read-only memory (ROM) 24.
In the foregoing structure, personal computer 10 uses work memory 12 for executing predetermined information processing.
The "PLC+personal computer" described above differs from the above board PLC in that the PLC is not formed of a PLC board structure, and is basically the same as the PLC board.
FIG. 17 shows steps of processing by the above PLC and "PLC+personal computer". Although FIG. 17 shows the steps of processing by the board PLC shown in FIG. 16, steps of processing by the "PLC+personal computer" are performed similarly to those shown in FIG. 17.
In FIG. 17, ladder interpreter 21 of PLC board 20 first fetches and decodes a ladder program stored in user memory UM of memory 22 in PLC board 20 for performing "instruction execution" (step S101). Results of this "instruction execution" are written into I/O memory IOM, and thereby the results of the "instruction execution" are reflected on I/O memory IOM of memory 22 of PLC board 20. When one "instruction execution" is completed, a request for "peripheral processing" is sent to microprocessor unit (MPU2) 23 of PLC board 20, and microprocessor unit (MPU2) 23 of PLC board 20 performs "peripheral processing" based on a peripheral processing program stored in read-only memory (ROM) 24 (step S102).
Thereafter, personal computer 10 reads out contents of I/O memory IOM for matching data held in personal computer 10 with data held in PLC board 20 (i.e., data held in memory 22 of PLC board 20), and "data exchange" is performed between personal computer 10 and PLC board 20 (step S103).
Thereafter, the device operates similarly, and more specifically performs "instruction execution" by ladder interpreter 21 (step S104), "peripheral processing" by microprocessor unit (MPU2) 23 (step S105), "instruction execution" by ladder interpreter 21 (step S106), "peripheral processing" by microprocessor unit (MPU2) 23 (step S107), "data exchange" between personal computer 10 and PLC board 20 (step S108), "instruction execution" by ladder interpreter 21 (step S109), and "peripheral processing" by microprocessor unit (MPU2) 23 (step S110).
Personal computer 10 performs predetermined "information processing" while "data exchange" is not being performed between personal computer 10 and PLC board 20 of personal computer 10 (steps S112 and S113).
The board PLC and the "PLC+personal computer" are designed to operate as follows. Microprocessor unit (MPU1) 11 of personal computer 10 performing information processing is notified that "data exchange" is allowed every time PLC board 20 or the unillustrated PLC completes one cycle of sequence control formed of "instruction execution" and "peripheral processing". At this time, if microprocessor unit (MPU1) 11 of personal computer 10 has already completed one cycle of "information processing", "data exchange" is performed. If microprocessor unit (MPU1) 11 of personal computer 10 has not yet completed one cycle of "information processing", "data exchange" is not performed, and microprocessor unit (MPU1) 11 of personal computer 10 continues "information processing". Thus, in the board PLC and the "PLC+personal computer", "information processing" by microprocessor unit (MPU1) 11 or personal computer 10 is performed in such a manner that "data exchange" between personal computer 10 and PLC board 20 is not performed during one cycle of "information processing" from start to completion of "information processing".
FIG. 18 shows steps of processing by the foregoing software PLC. In this software PLC, the "instruction execution", "peripheral processing" and "information processing" are performed only by personal computer 10 shown in FIG. 16.
First, microprocessor unit (MPU1) 11 of personal computer 10 fetches and decodes a ladder program stored in user memory UM to perform "instruction execution" (step S121). Then, microprocessor unit (MPU1) 11 of personal computer 10 performs "peripheral processing" (step S122) and "data exchange" (step S124), and thereafter microprocessor unit (MPU1) 11 of personal computer 10 performs "information processing" (step S124).
Thereafter, the device operates similarly, and more specifically microprocessor unit (MPU1) 11 of personal computer 10 repeats "instruction execution" (step S125), "peripheral processing" (step S125), "data exchange" (step S127) and "information processing" (step S128).
In the above steps of processing by the software PLC, "information processing" is performed each time "sequence control" is performed several times in view of a volume of "information processing" and a period of "sequence control" formed of "instruction execution" and "peripheral processing".
FIG. 19 is a flow chart specifically showing steps of processing of the software PLC shown in FIG. 18. Referring to FIG. 19, upon start (step S161), power-on and, in particular, initial setting are performed (step S162), and then a ladder program stored in user memory UM is fetched and decoded (step S163) to perform "instruction execution" (step S164).
The results of execution are written into I/O memory IOM, so that the results of execution are reflected on I/O memory IOM (step S165).
Then, it is determined whether this "instruction execution" is completed or not (S166). If not (NO at step S166), the process returns to step S163, and processing from step S163 to step S166 is repeated. If it is determined that "instruction execution" is completed (YES at step S166), peripheral processing such as I/O refreshing is then executed (step S167).
It is determined whether the ladder program stored in user memory UM is entirely completed or not (step S168). If not (NO at step S168), the process returns to step S163. If it is determined that the ladder program is completed (YES at step S168), the process is completed (step S169).
FIG. 20 is a flow chart showing steps of processing by the personal computer in the board PLC, the "PLC+personal computer" and the software PLC. When the personal computer starts up (step S131), it is first determined whether a request for data exchange is present or not (step S132). If present (YES at step S132), "data exchange" is performed (step S133), and then "information processing" is executed (step S134). Then, it is determined whether "information processing" is completed or not (step S135). If not (NO at step S135), the process returns to step S134, and this "information processing" is continued. If it is determined that "information processing" is completed at step S135 (YES at step 135), it is then determined whether all the processing is completed or not (step S136). If not (NO at step S136), the process returns to step S132, and processing from step S132 to step 136 is repeated. If it is determined that all the processing is completed at step S136 (YES at step S136), this process is completed (step S137).
FIG. 21 specifically shows steps of processing in the board PLC and the "PLC+personal computer". With reference to FIG. 21, description will be given on the steps of processing by the board PLC shown in FIG. 16. However, the steps of processing by the "PLC+personal computer" are substantially the same as those shown in FIG. 21.
Referring to FIG. 21, upon start (step S141), microprocessor unit (MPU1) 11 of personal computer 10 as well as microprocessor unit (MPU2) 23 and ladder interpreter 21 of PLC board 20 are powered on, and initial setting of them is performed (step S142). Then, start-up of PLC is instructed (step S143), and thereby microprocessor unit (MPU2) 23 of PLC board 20 instructs start-up of ladder interpreter 21 Step S151).
Upon start-up of ladder interpreter 21 of PLC board 20 (step S152), ladder interpreter 21 performs "instruction execution" by fetching and decoding a ladder program stored in user memory UM of memory 22 in PLC board 20 Step S153). Results of this execution are written into I/O memory IOM of memory 22, so that the results of execution are reflected on I/O memory IOM.
Upon completion of one "instruction execution", ladder interpreter 21 sends a request for "peripheral processing" to microprocessor unit (MPU2) 23 of PLC board 20, and microprocessor unit (MPU2) 23 of PLC board 20 performs "peripheral processing" based on a peripheral processing program stored in read-only memory (ROM) 24 Step S154).
Microprocessor unit (MPU1) 11 of personal computer 10 instructs start-up of PLC at step S143, and then determines whether data requiring information processing is present or not Step S144). If data requesting information processing is present (YES at step S144), "information processing" is performed (step S145). When this "information processing" is completed, microprocessor unit (MPU2) 23 of PLC board 20 is notified that data exchange is being waited for (step S146).
When it is determined that no data requiring information processing is present at step S144 (NO at step S144), the process advances to step S146 without performing "information processing" at step S145, and the fact that data exchange is being waited for is notified to microprocessor unit (MPU2) 23 of PLC board 20.
When "peripheral processing" at step S154 is completed, microprocessor unit (MPU2) 23 of PLC board 20 determines whether microprocessor unit (MPU1) 11 of personal computer 10 has issued a notice of wait for data exchange (step S155). If not (NO at step S155), the process returns to step S153.
If it is determined that a notification of wait for data exchange is present at step S155 (YES at step S155), a notification that data exchange is allowed is sent to microprocessor unit (MPU1) 11 of personal computer 10 (step S156).
Microprocessor unit (MPU1) 11 of personal computer 10 determines whether or not microprocessor unit (MPU2) 23 of PLC board 20 has notified that data exchange is allowed, i.e., whether data exchange is allowed or not (step S147), after notifying microprocessor unit (MPU2) 23 of PLC board 20 that data exchange is being waited. If data exchange is not allowed (NO at step S147), the process returns to step S146.
If it is determined that data exchange is allowed at step S147 (YES at step S147), "data exchange" is performed between microprocessor unit (MPU1) 11 of personal computer 10 and microprocessor unit (MPU2) 23 of PLC board 20 (steps S148 and S157).
Microprocessor unit (MPU1) 11 of personal computer 10 then determines whether all "information processing" is completed or not (step S149). If all "information processing" is not completed (NO at step S149), the process returns to step S145, and processing from step S145 to step S149 is repeated. When it is determined that all "information processing" is completed at step S149 (YES at step S149), microprocessor unit (MPU1) 11 of personal computer 10 finishes the processing (step S150).
Microprocessor unit (MPU2) 23 of PLC board 20 determines whether all "sequence processing" is completed or not when "data exchange" is completed (step S158). If all "sequence processing" is not completed (NO at step S158), the process returns to step S153, and processing starting from step S153 are repeated. If it is determined that all "sequence processing" is completed at step S158 (YES at step S158), processing by microprocessor unit (MPU2) 23 of PLC board 20 is finished (step S159).
The board PLC, "PLC+personal computer" and software PLC described above require "data exchange" by reading out contents of I/O memory IOM by the personal computer. However, the determination whether "data exchange" by the personal computer is to be performed or not is made only when "information processing" by the personal computer is finished. Thus, according to the board PLC, "PLC+personal computer" and software PLC, the personal computer continues "information processing" until the end of "information processing", and determines whether "data exchange" is to be performed or not when "information processing" is completed.
According to the software PLC, "information processing" operation is performed only when a constant number of requests for data exchange are counted. In this case, the above constant number is utilized to adjust a ratio between times of "sequence control" and times of "information processing".
The board PLC and the "PLC+personal computer" must employ dedicated microprocessor units for performing the "instruction execution" and "peripheral processing" as well as memories for storing peripheral processing program, resulting in expensive structures.
According to the software PLC, a cycle of "sequence processing" and a cycle of "information processing" are successively performed, so that a long time is disadvantageously required before start of a subsequent cycle of "sequence control".
According to the software PLC, the user program is executed by fetching and decoding the ladder program stored in user memory UM, and thereby "instruction execution" reflecting results of the execution on I/O memory IOM is performed. After the ladder program stored in user memory UM is entirely executed, "peripheral processing" is performed, and specifically the state of each I/O port I/O is reflected on I/O memory IOM by I/O refreshing. Since the foregoing operations are performed as one cycle of the process, an execution speed is disadvantageously slow.
Accordingly, an object of the present invention is to provide an information processing device and an information processing method, which allow an inexpensive structure of a whole system, and can perform information processing with a minimized influence exerted on a cycle of sequence processing.
Another object of the invention is to provide a device and a method for sequence control, which allow an inexpensive structure of a whole system, and can increase an execution speed.